package book;

import java.util.Arrays;

//书架
public class Booklist {
    private Book[] booklist=new Book[10];
    private int booklistsize;

    public Booklist() {
        booklist[0]=new Book("三国演义","罗贯中",39,"名著");
        booklist[1]=new Book("红楼梦","曹雪芹",49,"名著");
        booklist[2]=new Book("西游记","吴承恩",29,"名著");
        booklistsize=3;

    }
    public Book[] getBooklist() {
        return booklist;
    }//返回数组。
    public Book getBook(int pos) {
        return booklist[pos];
    }
    public void setBook (Book book ,int pos) {//放书，将传入的形参中的book实例的引用交给下标为pos的数组成员。
        booklist[pos]=book;
    }
    public int getBooklistsize() {
        return booklistsize;
    }//当前书架书的数量
    public void setBooklistsize(int booklistsize) {
        this.booklistsize = booklistsize;
    }//修改书架书的数量

    public static void main(String[] args) {
        System.out.println(new Booklist().getBook(0));
    }
}
